package com.ruoyi.info.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.info.domain.FhInfoUser;
import com.ruoyi.info.mapper.FhInfoUserMapper;
import com.ruoyi.info.service.IFhInfoUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-28
 */
@Service
public class FhInfoUserServiceImpl implements IFhInfoUserService 
{
    @Autowired
    private FhInfoUserMapper fhInfoUserMapper;

    /**
     * 查询用户信息
     * 
     * @param id 用户信息主键
     * @return 用户信息
     */
    @Override
    public FhInfoUser selectFhInfoUserById(Long id)
    {
        return fhInfoUserMapper.selectFhInfoUserById(id);
    }

    /**
     * 查询用户信息列表
     * 
     * @param fhInfoUser 用户信息
     * @return 用户信息
     */
    @Override
    public List<FhInfoUser> selectFhInfoUserList(FhInfoUser fhInfoUser)
    {
        return fhInfoUserMapper.selectFhInfoUserList(fhInfoUser);
    }

    /**
     * 新增用户信息
     * 
     * @param fhInfoUser 用户信息
     * @return 结果
     */
    @Override
    public int insertFhInfoUser(FhInfoUser fhInfoUser)
    {
        return fhInfoUserMapper.insertFhInfoUser(fhInfoUser);
    }

    /**
     * 修改用户信息
     * 
     * @param fhInfoUser 用户信息
     * @return 结果
     */
    @Override
    public int updateFhInfoUser(FhInfoUser fhInfoUser)
    {
        fhInfoUser.setUpdateTime(DateUtils.getNowDate());
        return fhInfoUserMapper.updateFhInfoUser(fhInfoUser);
    }

    /**
     * 批量删除用户信息
     * 
     * @param ids 需要删除的用户信息主键
     * @return 结果
     */
    @Override
    public int deleteFhInfoUserByIds(Long[] ids)
    {
        return fhInfoUserMapper.deleteFhInfoUserByIds(ids);
    }

    /**
     * 删除用户信息信息
     * 
     * @param id 用户信息主键
     * @return 结果
     */
    @Override
    public int deleteFhInfoUserById(Long id)
    {
        return fhInfoUserMapper.deleteFhInfoUserById(id);
    }


    @Override
    public FhInfoUser selectFhInfoUserByUserId(Long userId) {
        return fhInfoUserMapper.selectFhInfoUserByUserId(userId);
    }
}
